<template>
  <div>
    <div>
      <span class="time"></span>
      <span class="count"></span>
    </div>
  </div>
</template>

<script setup lang="ts">
import { createTimer } from "animejs";
import { onMounted } from "vue";
onMounted(() => {
  const $time = document.querySelector(".time");
  const $count = document.querySelector(".count");

  console.log(document.querySelectorAll(".value"));
  const timer = createTimer({
    duration: 1000,
    loop: true,
    frameRate: 30,
    onUpdate: (self) => ($time.innerHTML = self._currentTime.toString()),
    onLoop: (self) => ($count?.innerHTML = self._currentIteration),
  });
  timer.play();
});
</script>
